package service.Impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.Department;
import service.DepartmentService;
import dao.DepartmentDao;
import java.util.List;

@Service
public class DepartmentServiceImpl implements DepartmentService {

    @Autowired
    private DepartmentDao departmentDao;

    @Override
    public int insertDepartment(Department department) {
        return departmentDao.insertDepartment(department);
    }

    @Override
    public int deleteDepartmentById(int departmentId) {
        return departmentDao.deleteDepartmentById(departmentId);
    }

    @Override
    public int updateDepartment(Department department) {
        return departmentDao.updateDepartment(department);
    }

    @Override
    public Department selectDepartmentById(int departmentId) {
        return departmentDao.selectDepartmentById(departmentId);
    }

    @Override
    public List<Department> selectAllDepartments() {
        return departmentDao.selectAllDepartments();
    }
    @Override
    public List<Department> selectAllDepartmentsWithDoctors() {
        return departmentDao.selectAllDepartmentsWithDoctors();
    }
}